﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WeManageForm
{
    public partial class ExitForm : Form
    {
        public Point mouseDownPoint;

        public ExitForm()
        {
            this.StartPosition = FormStartPosition.CenterParent;
            InitializeComponent();
        }

        private void BtnExit_Click(object sender, EventArgs e)
        {            
            this.Close();
            System.Environment.Exit(0);
        }

        private void BtnExit_MouseHover(object sender, EventArgs e)
        {
            LblTipFace.Image = WeManageForm.Properties.Resources.Tip3;
        }

        private void BtnExit_MouseLeave(object sender, EventArgs e)
        {
            LblTipFace.Image = WeManageForm.Properties.Resources.Tip41;
        }


        private void BtnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void BtnCancel_MouseHover(object sender, EventArgs e)
        {
            LblTipFace.Image = WeManageForm.Properties.Resources.Tip2;
        }

        private void BtnCancel_MouseLeave(object sender, EventArgs e)
        {
            LblTipFace.Image = WeManageForm.Properties.Resources.Tip41;
        }

        private void ExitForm_MouseDown(object sender, MouseEventArgs e)
        {
            mouseDownPoint = new Point(e.X, e.Y);
        }

        private void ExitForm_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.Location = new Point(this.Location.X + e.X - mouseDownPoint.X,
                    this.Location.Y + e.Y - mouseDownPoint.Y);
            }
        }
    }
}
